<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>angular演示</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>
	<body>
		<div ng-app="app1" ng-controller="contro1">
			<div>
				<input type="text" name="name"  ng-model="name" />
				<input type="button" value="清除" ng-click="clearVal()"/>
			</div>
			<div>
				hello, {{name}}				
			</div>
		</div>
		<script type="text/javascript">
			//初始化模块
			var app1=angular.module("app1",[]);
			//定义模块名称 依赖注入
			app1.controller("contro1",["$scope",function($scope){
			
					$scope.name="ck";	
					$scope.clearVal=function(){
						$scope.name="";
					};
			}]);
		</script>
	</body>
</html>
